#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSplitter>
#include <QTreeView>
#include <QStandardItemModel>
#include <QTabWidget>
#include <QFileDialog>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QMessageBox>
#include <QInputDialog>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_open_project_triggered();
    void onFileListItemClicked(const QModelIndex &index);
    void onTabWidgetClosed(int index);
    void onFileListItemChanged(QStandardItem* item);
    void on_new_file_triggered();
    void on_save_code_triggered();
    void on_run_code_triggered();

private:
    void getSubdirAndFiles(QString dir, QString prefix, QStandardItem* itemModel);

private:
    Ui::MainWindow *ui;
    QStandardItemModel* _model { nullptr };
    QString _project;
    QTabWidget* _tab;
    QTabWidget* _console;
};
#endif // MAINWINDOW_H
